﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<t_205_verk_hopur_12.Models.ChannelNoticeViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tilkynningar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Tilkynningar</h2>
    
    <p>
        <%= Html.ActionLink("Búa til tilkynningu", "NoticeCreate", new { id = Model.Channel.ID }, null)%>
    </p>

    <% if(Model.Notice.Count() > 0) { %>
        <table class="NeatTable">
        <tr>
            <th>Titill</th>
            <th>Dags:</th>
        </tr>
        <tr>
        <% foreach (var item in Model.Notice) { %>
                <td>
                <%= item.Title %>
                </td>
                 <td>
                <%= item.CreationDate %>.
                </td>
                <td>
                <%= Html.ActionLink("Breyta", "NoticeEdit", new { channelID = item.ChannelID, noteID = item.ID}, null ) %>
                </td>
            </tr>
        <% } %>
    <% } else { %>
        <p>&nbsp;</p>
        <p>Engar tilkynningar eru skráðar</p>
    <% } %>

    </table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LogoText" runat="server">
    <%= Html.ActionLink(Model.Channel.Name, "Index", new { id = Model.Channel.ID }) %>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="MenuBar" runat="server">
    <% Html.RenderPartial("AdminChannelMenuBar", Model.Channel); %>
</asp:Content>

